<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>filter</title>
  <script type="text/javascript">
  <!--
	window.alert=function(s){console.log(s);};
	var r;
	var arr;
	arr = [1, 2, 4, 5, 6, 9, 10, 15];
	r = arr.filter(function (x) {
		return x % 2 !== 0;
	});
	alert(r); // [1, 5, 9, 15]
	
	arr = ['A', '', 'B', null, undefined, 'C', '  '];
	r = arr.filter(function (s) {
		return s && s.trim(); // 注意：IE9以下的版本没有trim()方法
	});
	alert(r); // ['A', 'B', 'C']
	
  //-->
  </script>
 </head>
 <body>
  
 </body>
</html>
